package zy1208.zy3;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class demo {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("zy1208.zy3.Dog");
        Method m = aClass.getDeclaredMethod("cell");
        m.setAccessible(true);
        Constructor<?> c = aClass.getConstructor();
        Object o = c.newInstance();
        m.invoke(o,null);

        Method s = aClass.getDeclaredMethod("sleep");
        s.setAccessible(true);
        Constructor<?> c1 = aClass.getConstructor();
        Object o1 = c1.newInstance();
        s.invoke(o1,null);
    }
}
